

<%

'**************************************************
'函数名：check_Permissions
'作  用：判断用户对某资源是否有权限
'参  数：user_id=用户id,res_page_code=资源代码对应字段res_num
'返回值：True/False
'**************************************************
Function check_Permissions(user_id,res_page_code)
 
 
 Dim rsObj_checklogin,strSql_cl,TotalRsNum
	 Set rsObj_checklogin = Server.CreateObject("ADODB.Recordset")
	strSql_cl=""
	strSql_cl=strSql_cl & " SELECT DISTINCT T_RES.* "
	strSql_cl=strSql_cl & " FROM T_RES INNER JOIN T_ROLE_RES INNER JOIN T_USER_ROLE  "
	strSql_cl=strSql_cl & " ON T_ROLE_RES.role_id = T_USER_ROLE.role_id ON  T_RES.id = T_ROLE_RES.res_id "
	strSql_cl=strSql_cl & " WHERE (T_USER_ROLE.user_id ='"&trim(user_id)&"') AND (T_RES.res_num = '"& res_page_code &"') "
	''strSql_cl=strSql_cl & " ORDER BY T_RES.res_ppath, T_RES.menu_num "
	''Response.Write strSql_cl&"-----"
	strSql_cl = "select count(*)  from ( " & strSql_cl & " ) kksds "
	if (0<PE_CLng(Conn.Execute(strSql_cl)(0))) then 
		check_Permissions=True
	else
		check_Permissions =False
	end if
End Function

 
%>
